package com.zh.mediaservice.controller.Doctor;

import com.zh.mediacommon.result.Result;
import com.zh.mediapojo.vo.ReserveVO;
import com.zh.mediaservice.service.DoctorReserveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController("doctorReserveController")
@RequestMapping("/doctor")
public class ReserveController {

    @Autowired
    private DoctorReserveService doctorReserveService;
    @PutMapping("/reserveNum")
    public Result setReserveNum(@RequestParam Integer doctorId,@RequestParam(required = false) Integer amNum,@RequestParam(required = false) Integer pmNum){

        doctorReserveService.setReserveNum(amNum,pmNum,doctorId);
        return Result.success("等待审核中....");
    }
    @GetMapping("/getReserveNum/{doctorId}")
    public Result<ReserveVO> getReserveNum(@PathVariable Integer doctorId){
        ReserveVO reserveVO = doctorReserveService.getReserveNum(doctorId);
        return Result.success(reserveVO);
    }
}
